<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Province extends BaseModel
{

    protected $table = 'province';

    protected $primaryKey = 'id';

    const CREATED_AT = null;
    const UPDATED_AT = null;

    protected $dateFormat = 'U';

    protected $fillable = [
        'name',
        'parentid'
    ];

    public function parent(){
        return $this->belongsTo(Province::class,'parentid');
    }

    public function children(){
        return $this->hasMany(Province::class,'parentid');
    }
}
